package com.myway.core.common;

import java.util.HashMap;
import java.util.Map;

public enum RCabinLimitStatus {
	
	ACTIVE("1"),
	INACTIVE("0");
	
	private String alias;
	
	private static Map<String, RCabinLimitStatus> map;
	
	static 
	{
		map = new HashMap<String, RCabinLimitStatus>();
		for (RCabinLimitStatus type : RCabinLimitStatus.values()) {
			map.put(type.alias, type);
		}
	}
	
	RCabinLimitStatus(String alias) {
		this.alias = alias;
	}
	
	public static RCabinLimitStatus valueOfAlias(String alias){
		RCabinLimitStatus status = map.get(alias);

		if (status == null) {
			throw new IllegalArgumentException("Unknown action alias [" + alias + "]");
		}

		return status;
	}
}
